<?PHP
/**
 * @file
 * Represents DONATE information that corresponds to the Donation table in the Database
 *
 * Copyright 2011 by Matt Edmonds This program is part of DONATE.
 * DONATE is free software.  It comes with absolutely no warranty.
 * You can redistribute it and/or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation
 * (see <http://www.gnu.org/licenses/ for more information).
 *
 * @version April 14th 2011
 * @author Matt Edmonds, Chris Reekie
 */

class Donation {
	private $donationID;     // Int Auto-Increment, Primary Key, Representing the specific Donation
	private $donationDate;    // Date, Date of Specific donation
	private $donorID;      //Int, Foreign Key, Identification of specific donor
	private $eventID;        // Int, Foreign Key, Representing
	 


	/**
	 * Constructs a newly created Donation object with argument values.
	 *@param int $donationID The donationID value to be assigned to this object
	 *@param string $donationDate The donationDate value to be assigned to this object
	 *@param int $donorID The donorID value to be assigned to this object
	 *@param int $eventID The eventID name value to be assigned to this object
	 */
	function __construct($x, $y, $z)
	{
		$this->donationID = null;
		$this->donationDate = $x;
		$this->donorID = $y;
		$this->eventID = $z;
	}
	
	/**
	 * Sets this donations's donationID to the specified argument value.
	 * @param int $donationID The donationID value to be assigned to this object.
	 */
	function setDonationID($donationID) {
		$this->donationID = $donationID;
	}

	/**
	 * Sets this donations's donationDate to the specified argument value.
	 * @param int $donationDate The donationDate value to be assigned to this object.
	 */
	function setdonationDate($donationDate) {
		$this->donationDate = $donationDate;
	}

	/**
	 * Sets this donations's donorID to the specified argument value.
	 * @param int $donorID The donorID value to be assigned to this object.
	 */
	function setdonorID($donorID) {
		$this->donorID = $donorID;
	}

	/**
	 * Sets this donations's eventID to the specified argument value.
	 * @param int $eventID The eventID value to be assigned to this object.
	 */
	function seteventID($eventID) {
		$this->eventID = $eventID;
	}
	 
	/**
	 * Returns the donationID of this Donation.
	 * @return The donationID of this Donation.
	 */
	function getDonationID(){
		return $this->donationID;
	}
	/**
	 * Returns the donationDate of this Donation.
	 * @return The donationDate of this Donation.
	 */
	function getDonationDate(){
		return $this->donationDate;
	}
	/**
	 * Returns the donorID of this Donation.
	 * @return The donorID of this Donation.
	 */
	function getDonorID(){
		return $this->donorID;
	}
	/**
	 * Returns the eventID of this Donation.
	 * @return The eventID of this Donation.
	 */
	function getEventID(){
		return $this->eventID;
	}
	
	function printAllAttributes()
  {
    $output = sprintf("date: %s, donorID: %d, eventID: %d.", 
                      $this->donationDate,$this->donorID, $this->eventID);
    return $output;
  }
}